import { request } from "@umijs/max";

export async function get_product_list():Promise<BackendResponse<any>>  {
    return request(`/admin-api/admin/product/selectProduct`, {
        method: 'GET',
    });
}

export async function getOrderStatus():Promise<BackendResponse<any>>  {
    return request(`/admin-api/system/dict-type//enum/OrderStatusEnum`, {
        method: 'GET',
    });
}

export async function getTruckOrderInfo(orderCode:string):Promise<BackendResponse<any>>  {
    return request(`/admin-api/system/truck-order/get/${orderCode}`, {
        method: 'GET',
    });
}

export async function refreshTruckOrderInfo(orderCode:string):Promise<BackendResponse<any>>  {
    return request(`/admin-api/system/truck-order/refresh/${orderCode}`, {
        method: 'GET',
    });
}

export async function pageListTruckOrders(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}
//包裹分页
export async function pageListTruckOrderBoxs(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/box/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}
//订单日志分页
export async function pageListTruckOrderLogs(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/log/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

//订单提单分页
export async function pageListTruckOrderBols(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/bol/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

//订单提单刷新
export async function refreshTruckOrderBols(orderCode: string): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/truck-order/refresh-bol/${orderCode}`;
    return request(url, {
        method: 'GET',
    });
}

//物流信息分页
export async function pageListTruckOrderTracks(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/track/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

//指定订单账单信息分页
export async function pageListTruckOrderFees(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/fee/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}


export async function quotation(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order-quotation/quotation';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

export async function saveOrder(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order-quotation/save-order';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

//客户账单详情分页
export async function pageCustomersListTruckOrderFees(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/fee_info/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

export async function addTruckOrderExtendFee(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/fee_info';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

export async function deleteTruckOrderExtendFee(id: string): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/truck-order/fee_info/${id}`;
    return request(url, {
        method: 'DELETE',
    });
}


export async function exportData(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/fee_info/export';
    return request(url, {
        method: 'GET',
        params: params,
    });
}


//申请取消订单
export async function applyCancelTruckOrder(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/cancel';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

//审批取消订单
export async function approvalCancelTruckOrder(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/approval';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

export async function getAccountStat(): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/account/stat';
    return request(url, {
        method: 'GET',
        // params: params,
    });
}


//服务商原始账单详情分页
export async function pageListTruckOrderServiceFees(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/truck-order/server-fee/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}
export async function getTruckOrderServiceFeeinfo(orderCode: string): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/truck-order/server-fee/get/${orderCode}`;
    return request(url, {
        method: 'GET',
    
    });
}